<?php
/**
 *  
 * @package package_name
 * @author Mervin.Wong<mervin0502@163.com>
 * @copyright
 * @license  http://www.apache.org/licenses/LICENSE-2.0
 * @version 0.1.0
 * @date 2013-3-8下午9:06:28
 *
 */
 
 if(!function_exists('pagination_set')){
	 function pagination_set($url, $total, $per, $segment){
	 	   $ci = & get_instance();
	  		$ci->load->library('pagination');
		  	/**
		  	 * 分页配置
		  	 */	
		    $config['base_url'] = $url;
		    $config['total_rows'] = $total;
		    $config['per_page'] = $per;
		    $config['num_links'] = 1;
		    $config['uri_segment'] = $segment;
		    $config['use_page_numbers'] = TRUE;
		    
		    $config['full_tag_open'] = '<div class="pagination">';
		    $config['full_tag_close'] = '</div>';
		    
		    $config['first_link'] = '首页';
		    $config['first_tag_open'] = '<span>';
		    $config['first_tag_close']='</span>';
		    
		    $config['last_link'] ='尾页';
		    $config['last_tag_open'] ='<span>';
		    $config['last_tag_close'] ='</span>';
		    
		    $config['prev_link'] = '上一页';
		    $config['prev_tag_open'] = '<span class="pre_page">';
		    $config['prev_tag_close'] ='</span>';
		    
		    $config['next_link'] = '下一页';
		    $config['next_tag_open'] = '<span class="next_page">';
		    $config['next_tag_close'] = '</span>';
		    
		    $config['cur_tag_open'] = '<span class="cur_page">';
		    $config['cur_tag_close'] ='</span>';
		    
		    $config['num_tag_open'] = '<span>';
		    $config['num_tag_close'] = '</span>';
		    
		    $ci->pagination->initialize($config);	
		    return $ci->pagination->create_links();
		} 	
 }
?>
